<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.28.
   家居商家通知控制器($$)*/

!defined('Q_PATH') && exit;

class JiajucompanynoticeController extends AController{

	public function filter_(&$arrMap){
		$arrMap['A.jiajucompanynotice_username']=array('like',"%".Q::G('jiajucompanynotice_username')."%");
		$arrMap['A.jiajucompanynotice_content']=array('like',"%".Q::G('jiajucompanynotice_content')."%");
		
		// 添加时间
		$this->getTime_('A.create_dateline',$arrMap);
	}

	public function index($sModel=null,$bDisplay=true){
		parent::index('jiajucompanynotice',false);
		$this->display(Admin_Extend::template('jiaju','jiajucompanynotice/index'));
	}

	public function add(){
		$this->display(Admin_Extend::template('jiaju','jiajucompanynotice/add'));
	}

	public function edit($sMode=null,$nId=null,$bDidplay=true){
		$nId=intval(Q::G('value','G'));
		parent::edit('jiajucompanynotice',$nId,false);
		$this->display(Admin_Extend::template('jiaju','jiajucompanynotice/add'));
	}

	public function insert($sModel=null,$nId=null){
		$nId=Q::G('value');
		$this->timeFormat_();
		parent::insert('jiajucompanynotice',$nId);
	}

	public function update($sModel=null,$nId=null){
		$nId=Q::G('value');
		$this->timeFormat_();
		parent::update('jiajucompanynotice',$nId);
	}

	public function forbid($sModel=null,$sId=null,$bApp=false){
		$nId=intval(Q::G('value','G'));
		parent::forbid('jiajucompanynotice',$nId,true);
	}

	public function resume($sModel=null,$sId=null,$bApp=false){
		$nId=intval(Q::G('value','G'));
		parent::resume('jiajucompanynotice',$nId,true);
	}

	public function foreverdelete_deep($sModel=null,$sId=null){
		$sId=Q::G('value');
		parent::foreverdelete_deep('jiajucompanynotice',$sId);
	}

	protected function timeFormat_(){
		$_POST['jiajucompanynotice_expiration']=strtotime($_POST['jiajucompanynotice_expiration']);
	}

}
